﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsService1
{
    #region 1、系统内部
    public class AcquisitionTypeConfig
    {
        public AcquisitionType Name { get; set; }
        public string MqttTopic { get; set; }
        public bool IsRobot { get; set; }
        public bool IsEnabled { get; set; }
        public string ProcessType { get; set; }
        public string RobotTopicPrefix { get; set; }
        public int Priority { get; set; }
        public bool RequiresSubscription { get; set; }
    }

    /// <summary>
    /// 客户端组映射配置
    /// </summary>
    public class ClientGroupMapping
    {
        public string ClientId { get; set; }
        public string Description { get; set; }
        public int CollectionIntervalMs { get; set; }
        public string[] CollectionGroupNames { get; set; }
        public string MqttTopic { get; set; }
        public string ProcessType { get; set; }
    }

    public enum AcquisitionType
    {
        PPM,
        Axis,
        Cylinder,
        LRobot,
        LoadingRobotic,
        LoadingTransferRobotic,
        DischargeTransferRobotic,
        DischargeRobotic,
        InternalRobotic,
        UnpackingRobotic,
        FullNailingRobotic,
        ThicknessTransferRobotic,
        Parameter,
        ParameterDownload,
        ParameterUpload,
    }

    public enum PLCDataType
    {
        Short,
        Float
    }

    public class StationData
    {
        public string Name { get; set; }
        public object MainValue { get; set; }
        public DateTime Timestamp { get; set; }
        public string AdditionalData { get; set; } // 用于存储JSON等附加信息
    }

  

    public class TypeConfig
    {
        public string Name { get; set; }       // 字段名，例如 "Robot_Status"
        public string Address { get; set; }    // PLC地址，例如 "D24500"
        public string DataType { get; set; }   // 数据类型，例如 "Short"或"Float"
        public string GroupName { get; set; }  // 新增：所属CollectionGroup名称
    }



    public class CollectionGroupConfig
    {
        /// <summary>
        /// 
        /// </summary>
        public string Name { get; set; }
        public string RobotName { get; set; } // 新增：机械臂编号

        public string StartAddress { get; set; }
        public int Length { get; set; }
        public string DefaultDataType { get; set; } = "Short";
        public Dictionary<string, TypeConfig> Types { get; set; } = new Dictionary<string, TypeConfig>();
    }
    #endregion

    
}
